package com.misboot.document.client.fallbackFactory;

import cn.ewsd.common.controller.BaseController;
import com.misboot.document.client.MessageClient;
import com.misboot.document.client.SystemClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


/**
 * misboot-system相关接口 模块降级处理
 *
 * @Author 湖南佐佑时代科技有限公司
 * @Version 5.4.21
 * @Email service@zuoyo.com
 * @Date 2022-06-16 13:31:39
 */
@Component
public class SystemClientFallbackFactory extends BaseController implements FallbackFactory<SystemClient> {

    private static final Logger log = LoggerFactory.getLogger(SystemClientFallbackFactory.class);


    @Override
    public SystemClient create(Throwable throwable) {
        log.error("消息中心模块调用失败:{}", throwable.getMessage());

        return new SystemClient() {

            @Override
            public List<Map<String, Object>> getFilterListByApiUuid(String apiUuid) {
                return null;
            }

            @Override
            public List<Map<String, Object>> analysisExecl(String address) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getDataAuthList() {
                return null;
            }

            @Override
            public Map<String, Object> getSysConfigurationDetailByType(String type) {
                return null;
            }

            @Override
            public Object save(Map<String, Object> map) {
                return null;
            }

            @Override
            public Object saveapi(Map<String, Object> map) {
                return null;
            }

            @Override
            public String queryPermissionDataRule(String component) {
                return null;
            }

            @Override
            public Object getUserByUserNameId(String userNameId) {
                return null;
            }
        };
    }
}
